home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac 1993 September / September 93.iso / Archives / Games / Strategy / Puzzle / GameMaster / GM Dev Kit / Pascal Units / QuickDrawRules.p < prev   
Encoding:
Text File  |  1991-10-07  |  979 b   |  47 lines  |  [TEXT/PJMM]

  1. unit QuickDrawRules;
  2.  
  3. { ©1991 Quinn "The Eskimo" }
  4.  
  5. interface
  6.  
  7.     type
  8.         qdRecord = record
  9.                 randSeed: longint;
  10.                 screenBits: BitMap;
  11.                 arrow: Cursor;
  12.                 case integer of
  13.                     0: (
  14.                             dkGrey: Pattern;
  15.                             ltGrey: Pattern;
  16.                             grey: Pattern;
  17.                             black: Pattern;
  18.                             white: Pattern;
  19.                             thePort: GrafPtr;
  20.                     );
  21.                     1: (
  22.                             dkGray: Pattern;
  23.                             ltGray: Pattern;
  24.                             gray: Pattern;
  25.                     );
  26.             end;
  27.         qdRecordPtr = ^qdRecord;
  28.  
  29.     function QDGlobals: qdRecordPtr;
  30.     inline
  31.         $2015,                         { move.l     (a5),d0                 ; get thePort                                         }
  32.         $0480, $0000, $007E,     { subi.l     #$0000007E, d0     ; #$7E = (sizeof(qdRecord) - sizeof(thePort)) }
  33.         $2E80;                         { move.l     d0,(sp)                ; set result                                            }
  34.  
  35. implementation
  36.  
  37. end. { QuickDrawRules }
  38.  
  39. { Pascal for the above inline stuff }
  40.  
  41. function QDGlobals: qdRecordPtr;
  42.     type
  43.         longPtr = ^longint;
  44. begin
  45.     QDGlobals := qdRecordPtr(longPtr(SetCurrentA5)^ - (sizeof(qdRecord) - sizeof(thePort)));
  46. end; { QDGlobals }
  47.